const {
  $util, util,
} = getApp();
Page({
  data: {
    list: [],
  },
  onShow(opts) {
    this.loadList();
  },
  loadList() {
    $util.request({
      url: 'entry/wxapp/partyman.integral.getruletask',
      data: {},
      success: (res) => {
        this.setData({
          list: res.data,
          isLoad: true,
        });
      },
    });
  },
  goDetail(e) {
    let urlArr = e.currentTarget.dataset.url.split('?');
    let paramArr = {};
    if (urlArr.length > 1) {
      let param = urlArr[1].split('&');
      for (let i = 0; i < param.length; i++) {
        paramArr[param[i].split('=')[0]] = param[i].split('=')[1];
      }
    }
    util.navigateTo(urlArr[0], paramArr);
  },
});
